﻿namespace WMS6.Web.GlobalControl
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class WarehouseTransferQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlDestWhDBID;
        protected DropDownList ddlDestWhDBIDOper;
        protected DropDownList ddlIntransitID;
        protected DropDownList ddlIsActive;
        protected DropDownList ddlIsActiveOper;
        protected DropDownList ddlOrderDate;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlReceiptID;
        protected DropDownList ddlSrcWhDBID;
        protected DropDownList ddlSrcWhDBIDOpr;
        protected DropDownList ddlStatus;
        protected HtmlForm F13510;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected Label lblAllocateRule;
        protected Label lblDestWhDBID;
        protected Label lblIntransitID;
        protected Label lblIsActive;
        protected Label lblOrderDate;
        protected Label lblOrderID;
        protected Label lblOwnerID;
        protected Label lblReceiptID;
        protected Label lblSrcWhDBID;
        protected Label lblStatus;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtIntransitID;
        protected TextBox txtOrderDate;
        protected TextBox txtOrderID;
        protected TextBox txtOwnerID;
        protected TextBox txtReceiptID;
        protected TextBox txtStatus;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("WarehouseTransferList.aspx", false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlIntransitID, 0);
            base.InitQueryDDL(this.ddlSrcWhDBIDOpr, 0);
            base.InitQueryDDL(this.ddlDestWhDBIDOper, 0);
            base.BindData2DDL4WareHouse(this.ddlSrcWhDBID);
            base.BindData2DDL4WareHouse(this.ddlDestWhDBID);
            this.ddlDestWhDBID.Items.Insert(0, new ListItem("", ""));
            this.ddlSrcWhDBID.Items.Insert(0, new ListItem("", ""));
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlOrderDate, 1);
            base.InitQueryDDL(this.ddlReceiptID, 0);
            base.InitQueryDDL(this.ddlStatus, 0);
            base.InitQueryDDL(this.ddlIsActiveOper, 0);
            base.InitIsActiveDDL(this.ddlIsActive, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
            this.btnNew.Visible = false;
        }

        public string DestWhDBID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlDestWhDBID.SelectedValue))
                {
                    return base.GetParamsString(this.ddlDestWhDBID.SelectedValue, this.ddlDestWhDBIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string IntransitID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtIntransitID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtIntransitID.Text.Trim(), this.ddlIntransitID.SelectedValue);
                }
                return "";
            }
        }

        public string IsActive
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlIsActive.SelectedValue))
                {
                    return base.GetParamsString(this.ddlIsActive.SelectedValue, this.ddlIsActiveOper.SelectedValue);
                }
                return "";
            }
        }

        public string OrderDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderDate.Text.Trim(), this.ddlOrderDate.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptID.Text.Trim(), this.ddlReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string SrcWhDBID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlSrcWhDBID.SelectedValue))
                {
                    return base.GetParamsString(this.ddlSrcWhDBID.SelectedValue, this.ddlSrcWhDBIDOpr.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStatus.Text.Trim()))
                {
                    return base.GetParamsString(this.txtStatus.Text.Trim(), this.ddlStatus.SelectedValue);
                }
                return "";
            }
        }
    }
}

